import 'package:bruno/bruno.dart';

class TabFilterItem extends BrnSelectionEntity {
  String? type = 'radio';

  final String? defaultValue;

  final int? listSize;

  final String? value;

  final String? columnKey;

  TabFilterItem(
      {this.columnKey,
      this.listSize,
      this.type,
      this.defaultValue,
      this.value,
      required String label,
      required List child})
      : super(
          key: columnKey,
          title: label,
          children: listTypeConversion(child),
        );

  static List<BrnSelectionEntity> listTypeConversion(List list){
    if(list.length > 0) {
      return []
        ..addAll(list.map((item) => BrnSelectionEntity.fromMap(item)));
    }
    return [];
  }
}
